﻿using System;
using System.Collections.Generic;
using FreeSql.DataAnnotations;

namespace Colorful.Furniture.SysManagement
{
    /// <summary>
    ///  系统数据字典
    /// </summary>
    [Table(Name = "sys_dictionary")]
    public class SysDictionary
    {
        /// <summary>
        /// 编码
        /// </summary>
        [Column(Name = "id", IsPrimary = true, IsIdentity = true)]
        public Guid Id { get; set; }

        /// <summary>
        ///  代码
        /// </summary>
        [Column(Name = "code", StringLength = 50)]
        public string Code { get; set; }

        /// <summary>
        ///  标题
        /// </summary>
        [Column(Name = "title", StringLength = 50)]
        public string Title { get; set; }

        /// <summary>
        ///  备注
        /// </summary>
        [Column(Name = "remark", StringLength = 200)]
        public string Remark { get; set; }

        /// <summary>
        ///  值
        /// </summary>
        [Column(Name = "value", StringLength = 200)]
        public string Value { get; set; }

        /// <summary>
        ///  图标
        /// </summary>
        [Column(Name = "icon", StringLength = 30)]
        public string Icon { get; set; }

        /// <summary>
        ///  额外数据
        /// </summary>
        [Column(Name = "extra", StringLength = 4000)]
        public string Extra { get; set; }

        /// <summary>
        ///  是否为系统
        /// </summary>
        [Column(Name = "is_sys")]
        public bool IsSys { get; set; }

        /// <summary>
        ///  排序
        /// </summary>
        [Column(Name = "sort")]
        public int Sort { get; set; }

        /// <summary>
        ///  是否删除
        /// </summary>
        [Column(Name = "is_deleted")]
        public bool IsDeleted { get; set; }

        /// <summary>
        ///  父级编码
        /// </summary>
        [Column(Name = "parent_id")]
        public Guid? ParentId { get; set; }

        public virtual SysDictionary Parent { get; set; }

        public virtual IList<SysDictionary> Children { get; set; }
    }
}